trivial-httpd: Add __attribute__((format))
authorColin Walters <walters@verbum.org>
Sat, 7 May 2016 15:22:47 +0000 (11:22 -0400)
committerColin Walters <walters@verbum.org>
Sat, 7 May 2016 15:22:47 +0000 (11:22 -0400)
I was briefly looking at building with clang mostly since it
detects unused variables with cleanup attributes, but then
I hit this fatal error.

It's a hard compile error with `-Wformat-nonliteral` since clang
doesn't know it's a format string.

src/ostree/ot-builtin-trivial-httpd.c

index 0300b128295925c7c1c0a4a48d5dc76e56c80fb4..811e8924b02366826868e998f03dd687cf659a67 100644 (file)
@@ -56,6 +56,9 @@ static GOptionEntry options[] = {
   { NULL }
 };
 
+static void
+httpd_log (OtTrivialHttpd *httpd, const gchar *format, ...) __attribute__ ((format(printf, 2, 3)));
+
 static void
 httpd_log (OtTrivialHttpd *httpd, const gchar *format, ...)
 {